package com.example.permission.controller;

import com.example.permission.common.page.Page;
import com.example.permission.common.result.Result;
import com.example.permission.entity.dto.page.SysLoginLogPageDTO;
import com.example.permission.entity.po.SysLoginLog;
import com.example.permission.service.SysLoginLogService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 登录日志
 *
 * @author xuwq
 * @date 2020-05-09 15:56:07
 */
@RestController
@Api(tags = "登录日志")
public class SysLoginLogController {
    @Autowired
    private SysLoginLogService sysLoginLogService;

    @GetMapping("v1/login-log/{logId}")
    @ApiOperation(value = "根据id查询数据")
    public Result<SysLoginLog> queryById(@PathVariable("logId") Integer logId) {
        return Result.success(this.sysLoginLogService.queryById(logId));
    }

    @PostMapping("v1/login-log/multi")
    @ApiOperation(value = "根据id查询数据")
    public Result<Page<SysLoginLog>> queryListByPage(@RequestBody SysLoginLogPageDTO sysLoginLogPageDTO) {
        return Result.success(this.sysLoginLogService.queryListByPage(sysLoginLogPageDTO));
    }

}